﻿using Mengsk.ProxyDelivery.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mengsk.ProxyDelivery.Print.Domain.PrintDataFormatters
{
    class PrintDataFormatterOrder_Type : PrintDataFormatter
    {
        public override PrintTemplateItemTypes AcceptType
        {
            get { return PrintTemplateItemTypes.ORDER_TYPE; }
        }

        public override object Format(PrintTemplate template, PrintTemplateItem item, Order order)
        {
            if (order.CreateReason == ProxyDelivery.Domain.OrderCreateReason.NORMAL)
            {
                return "";
            }

            if (order.CreateReason == ProxyDelivery.Domain.OrderCreateReason.EXCHANGE)
            {
                return "换";
            }

            if (order.CreateReason == ProxyDelivery.Domain.OrderCreateReason.RETURN)
            {
                return "退";
            }

            throw new ArgumentException("订单 CreateReason未知:" + order.CreateReason);
        }
    }
}
